package com.home.simple.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class WelcomeController {

	@RequestMapping(method=RequestMethod.GET, value="/welcome")
	public ModelAndView sayWelcome(){
		ModelAndView mav = new ModelAndView("welcome");
		mav.addObject("message", "welcome friend!");
		return mav;
	}
	
	@RequestMapping(method=RequestMethod.GET, value="/welcome2")
	public String sayWelcomeAgain(Model model){
		model.addAttribute("message", "welcome again friend!");
		return "welcome";
	}
}
